﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiAPPAutomaticPathPlannerClearanceActiveCollisionSetWindow
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using C1.WPF.FlexGrid;
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands;

public class CUiAPPAutomaticPathPlannerClearanceActiveCollisionSetWindow : 
  TxWindow,
  IComponentConnector
{
  private CApAPPActiveCollisionClearanceViewModel _appVM;
  internal C1FlexGrid fgActiveCollisionList;
  internal Button btnRestoreDefaults;
  internal Button btnOK;
  internal Button btnCancel;
  private bool _contentLoaded;

  public CUiAPPAutomaticPathPlannerClearanceActiveCollisionSetWindow()
  {
    this.InitializeComponent();
  }

  private void TxWindow_Loaded(object sender, RoutedEventArgs e)
  {
    this._appVM = new CApAPPActiveCollisionClearanceViewModel();
    this.fgActiveCollisionList.ItemsSource = (IEnumerable) this._appVM.ActiveCollisionPairs;
  }

  private void btnCancel_Click(object sender, RoutedEventArgs e) => ((Window) this).Close();

  private void btnOK_Click(object sender, RoutedEventArgs e)
  {
    this._appVM.UpdateAttributes();
    ((Window) this).Close();
  }

  private void btnRestoreDefaults_Click(object sender, RoutedEventArgs e)
  {
    this._appVM.RestoreDefaults();
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  public void InitializeComponent()
  {
    if (this._contentLoaded)
      return;
    this._contentLoaded = true;
    Application.LoadComponent((object) this, new Uri("/DnProcessSimulateCommands;component/automaticpathplanner/activecollisionclearance/cuiappautomaticpathplannerclearanceactivecollisionsetwindow.xaml", UriKind.Relative));
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  [EditorBrowsable(EditorBrowsableState.Never)]
  void IComponentConnector.Connect(int connectionId, object target)
  {
    switch (connectionId)
    {
      case 1:
        ((FrameworkElement) target).Loaded += new RoutedEventHandler(this.TxWindow_Loaded);
        break;
      case 2:
        this.fgActiveCollisionList = (C1FlexGrid) target;
        break;
      case 3:
        this.btnRestoreDefaults = (Button) target;
        this.btnRestoreDefaults.Click += new RoutedEventHandler(this.btnRestoreDefaults_Click);
        break;
      case 4:
        this.btnOK = (Button) target;
        this.btnOK.Click += new RoutedEventHandler(this.btnOK_Click);
        break;
      case 5:
        this.btnCancel = (Button) target;
        this.btnCancel.Click += new RoutedEventHandler(this.btnCancel_Click);
        break;
      default:
        this._contentLoaded = true;
        break;
    }
  }
}
